package com.example.mapper;

import com.example.entity.Banner;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author: 康伟奇
 * @date: 2023 - 11 - 23 10:01
 **/
public interface BannerMapper {
    /**
     * 新增
     */
    int insert(Banner banner);

    /**
     * 删除
     */
    int deleteById(Integer id);

    /**
     * 修改
     */
    int updateById(Banner banner);

    /**
     * 根据ID查询
     */
    Banner selectById(Integer id);

    /**
     * 查询所有
     */
    List<Banner> selectAll(Banner banner);

    /**
     * 根据商家id删除数据
     * */
    @Delete("delete from banner where business_id = #{businessId}")
    int deleteByBusiness(@Param("businessId") Integer businessId);
}
